$OpenBSD: patch-Makefile,v 1.2 2016/09/23 09:16:58 sthen Exp $
--- Makefile.orig	Thu Mar  3 12:22:28 2016
+++ Makefile	Tue Sep 20 09:41:08 2016
@@ -4,6 +4,9 @@
 # I have added defaults for all of the systems that I use.
 # Good luck!
 
+# This is the file-system root for the CGI and web
+# programs and files.
+#WWWPREFIX	 = /var/www/
 # This is the directory prepended to all calendar requests.
 # It is relative to the CGI process's file-system root.
 # It contains the database.
@@ -34,12 +37,13 @@
 
 # ...and this for deployment on BSD.lv, which has its static files in a
 # virtual host and runs within a chroot(2).
+WWWPREFIX	 = /var/www
 CALDIR		 = /caldav
-CALPREFIX	 = /var/www/caldav
+CALPREFIX	 = $(WWWPREFIX)/caldav
 HTDOCS	 	 = /kcaldav
-HTDOCSPREFIX	 = /var/www/vhosts/www.bsd.lv/htdocs/kcaldav
+HTDOCSPREFIX	 = $(WWWPREFIX)/htdocs/kcaldav
 CGIURI		 = /cgi-bin/kcaldav.cgi
-CGIPREFIX	 = /var/www/cgi-bin
+CGIPREFIX	 = $(WWWPREFIX)/cgi-bin
 PREFIX		 = /usr/local
 
 # Add any special dependency directives here.
@@ -50,20 +54,23 @@ PREFIX		 = /usr/local
 # The -D DEBUG=2 directive LOTS of debugging information.
 
 #### For OpenBSD:
-LIBS		 = -lexpat -lm -lsqlite3
+LIBS		 = -L/usr/local/lib -lexpat -lm -lsqlite3
 STATIC		 = -static
-CPPFLAGS	+= -I/usr/local/include -DLOGTIMESTAMP=1 -DDEBUG=1
+STATICLIBS	 = -lpthread
+CPPFLAGS	+= -I/usr/local/include -DLOGTIMESTAMP=1 -DDEBUG=0
 BINLDFLAGS	 = -L/usr/local/lib
 
 #### For Mac OS X:
 #LIBS		 = -lexpat -lsqlite3
 #STATIC		 = 
+#STATICLIBS	 = 
 #CPPFLAGS	+= -I/usr/local/opt/sqlite/include -I/usr/local/include 
 #BINLDFLAGS	 = -L/usr/local/opt/sqlite/lib -L/usr/local/lib
 
 #### For Linux:
 #LIBS		 = -lexpat -lbsd -lm -lsqlite3
 #STATIC		 = 
+#STATICLIBS	 = 
 #CPPFLAGS	+= -I/usr/local/include 
 #BINLDFLAGS	 = -L/usr/local/lib
 
@@ -251,7 +258,7 @@ libkcaldav.a: $(LIBOBJS)
 	$(AR) -rs $@ $(LIBOBJS)
 
 kcaldav: $(BINOBJS) $(OBJS) libkcaldav.a
-	$(CC) $(BINCFLAGS) -o $@ $(STATIC) $(BINOBJS) $(OBJS) libkcaldav.a $(BINLDFLAGS) $(BINLIBS) 
+	$(CC) $(BINCFLAGS) -o $@ $(STATIC) $(BINOBJS) $(OBJS) libkcaldav.a $(BINLDFLAGS) $(BINLIBS) $(STATICLIBS)
 
 kcaldav.passwd: kcaldav.passwd.o md5.o $(OBJS) libkcaldav.a
 	$(CC) -o $@ kcaldav.passwd.o md5.o $(OBJS) libkcaldav.a $(LIBS)
